<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-','%mfile')"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('管理')"></div>
        <div th:replace="common/search::search('%add')"></div>
    </div>
</div>

<!--添加Choujiang模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">添加（说明：【每日最大出奖数】仅对一等奖、二等奖、三等奖有效）</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">奖品类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" onchange="jtypeChange(this.value)"
                                                            name="jtype">
                                                        <option value="1">积分</option>
                                                        <option value="2">优惠券</option>
                                                        <option value="3">商品</option>
                                                        <option value="4">现金红包</option>
                                                        <option value="5">谢谢参与</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">奖品名称</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="name" id="name2"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="axiexie">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label" id="lbname">请填写积分额</label>
                                                <div class="col-sm-8" id="aother">
                                                    <input class="form-control" name="value" type="number"/>
                                                </div>
                                                <div class="col-sm-8" id="aquan" style="display: none">
                                                    <select class="form-control select2" id="quansel"
                                                            onchange="quanChange(this.value)" id="fanquan">
                                                        <option th:each="c:${couponTpls}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                                <div class="col-sm-8" id="ashanpin" style="display: none">
                                                    <select class="form-control select2" id="goodssel"
                                                            onchange="shanpinChange(this.value)">
                                                        <option th:each="c:${goods}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">有效天数</label>
                                                <div class="col-sm-8">
                                                    <div class="input-group m-b">
                                                        <input class="form-control" name="days" type="number"
                                                               value="0"/>
                                                        <span class="input-group-addon">0表示长期有效</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">排序</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="sort"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否启用*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="state" value="1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">几等奖</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="level" readonly="">
                                                        <option value="1">1等奖</option>
                                                        <option value="2">2等奖</option>
                                                        <option value="3">3等奖</option>
                                                        <option value="4">4等奖</option>
                                                        <option value="5">5等奖</option>
                                                        <option value="6">6等奖</option>
                                                        <option value="7">7等奖</option>
                                                        <option value="8">8等奖</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">每日最大出奖数*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="maxnum" type="number" value="99999"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">该奖每人最高中奖次数*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="maxnumPuser" type="number" value="99999"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">抽奖图</label>
                                                <div class="col-sm-10">
                                                    <input id="mfile" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic" name="pic" type="hidden" value=""/>
                                    <input id="hidywid" name="ywid" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改Choujiang模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">修改（说明：【每日最大出奖数】仅对一等奖、二等奖、三等奖有效）</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">奖品类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="jtype" id="jtype" readonly="">
                                                        <option value="1">积分</option>
                                                        <option value="2">优惠券</option>
                                                        <option value="3">商品</option>
                                                        <option value="4">现金红包</option>
                                                        <option value="5">谢谢参与</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">奖品名称</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="name" name="name"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">面值</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="value" name="value" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">有效天数</label>
                                                <div class="col-sm-8">
                                                    <div class="input-group m-b">
                                                        <input class="form-control" id="days" name="days" type="number"
                                                               value="0"/>
                                                        <span class="input-group-addon">0表示长期有效</span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">排序</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="sort" name="sort"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否启用*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="state" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">几等奖</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="level" id="level" readonly="">
                                                        <option value="1">1等奖</option>
                                                        <option value="2">2等奖</option>
                                                        <option value="3">3等奖</option>
                                                        <option value="4">4等奖</option>
                                                        <option value="5">5等奖</option>
                                                        <option value="6">6等奖</option>
                                                        <option value="7">7等奖</option>
                                                        <option value="8">8等奖</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">每日最大出奖数*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="maxnum" name="maxnum" type="number" value="99999"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">该奖每人最高中奖次数*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="maxnumPuser" type="number" value="99999"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">抽奖图</label>
                                                <div class="col-sm-10">
                                                    <img id="previewPic" src='' class='file-preview-image' alt=''
                                                         title=''
                                                         style="width: 100px;height: 100px;"/>
                                                    <input id="mfile2" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic2" name="pic" type="hidden" value=""
                                    />
                                    <input id="id" name="id" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:include="common/footer_js::footer"></div>
<script src="/js/admin/choujiang.js"></script>
</body>
</html>
